<?php

	# try to kill all xss with htmlentries  
	
	# loop cookies
	foreach ($_COOKIE as &$cookie) {
		$cookie = htmlentities($cookie, ENT_QUOTES);
	}
	# loop posts
	foreach ($_POST as &$post) {
		if (is_array($post)) {
			foreach ($post as &$_post) {
				$_post = htmlentities($_post, ENT_QUOTES);
			}
		}
		else {
			$post = htmlentities($post, ENT_QUOTES);
		}
	}
	# loop gets
	foreach ($_GET as &$get) {
		if (is_array($get)) {
			foreach ($get as &$_get) {
				$_get = htmlentities($_get, ENT_QUOTES);
			}
		}
		else {
			$get = htmlentities($get, ENT_QUOTES);
		}
	}

?>